In [1]:
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
In [2]:
sess = tf.Session()
In [3]:
# Relu
print(sess.run(tf.nn.relu([-3., 3., 10.])))
In [4]:
# Relu6
# Set upper limit as 6
print(sess.run(tf.nn.relu6([-3., 3., 10.])))
In [5]:
# sigmoid
print(sess.run(tf.nn.sigmoid([-1., 0., 1.])))
In [6]:
# Hyperbolic tangent
print(sess.run(tf.nn.tanh([-1., 0., 1.])))
In [7]:
# Softsign function
print(sess.run(tf.nn.softsign([-1., 0., 1.])))
In [8]:
# Softplus function
print(sess.run(tf.nn.softplus([-1., 0., 1.])))
In [9]:
# ELU(Exponential Linear Unit)
print(sess.run(tf.nn.elu([-1., 0., 1.])))
In [ ]: